<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<script type="text/javascript">
$(function(){
	$('#inputForm input').tooltip();
    $('#inputForm').ajaxForm({ 
        type: "post",
        dataType:"json",
        clearForm: false,
        resetForm: false,
        beforeSubmit: function(){
        	var checkReturn = $('#inputForm').checkForm(null,false);
        	if(checkReturn){
        		$("#sbmBtn").attr("disabled","disabled");
        	}
	       return checkReturn;
        },
        success: function(resp){
        	
        	if(resp.status == '1' ){
        		ui.msg(resp.msg, 1);
        		ui.go(_ctx + '/pub/sysmgr/resmgr/res_list.do?refreshNode=' + '${selectedNodeId}');
        	}else{
        		ui.msg(resp.msg, 0);
        		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
        	}
        },
        error:function(resp){
        	ui.msg('请求发送失败', 0);
    		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
        }
    }); 
});
</script>
<div class="widget-body">
	<div class="widget-main">
		<form class="form-horizontal" role="form" id="inputForm" action="${ctx}/pub/sysmgr/resmgr/update_res.do"  method="post" >
			<input type="hidden" name="pid" id="operationType" value="${res.pid}" />
			<input type="hidden" name="type" id="type" value="${type}" />
			<input type="hidden" name="ordNum" id="ordNum" value="${res.ordNum}" />
			<input type="hidden" name="id" id="id" value="${res.id}" />
			<input type="hidden" name="actionId" id="actionId" value="${res.actionId}" />
			<div class="space-4"></div>
			<div class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">资源编码 *</div>
				<div class="col-sm-9">
					${res.id}
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">资源名称 *</div>
				<div class="col-sm-9">
					<input type="text" class="col-xs-10 col-sm-5" 
						value="${res.shortName}"  name="shortName" id="shortName"  datatype="require"  placeholder="请输入资源名称"
						msg="请输入资源名称" title="必填项,资源名称"/>
				</div>
			</div>
			<div class="space-4"></div>
			<div id="imgDiv" class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">菜单图标 </div>
				<div class="col-sm-9">
					<input type="text" class="col-xs-10 col-sm-5" 
						value="${res.img}"  name="img" id="img"  placeholder="请输入菜单图标"
						msg="请输入菜单图标"/>
				</div>
			</div>
			
			<div class="space-4"></div>
			<div class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">是否在新窗口打开</div>
				<div class="col-sm-9">
					<select name="openNewWindow" id="openNewWindow" value="${res.openNewWindow}" class="col-xs-10 col-sm-5" >
						${cm:ctoption('YESNO',res.openNewWindow) }
					</select>
				</div>
			</div> 
			<div class="space-4"></div>
			<div id="hiddenDiv" class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">是否隐藏 *</div>
				<div class="col-sm-9">
					<select name="hidden" id="hidden" value="${res.hidden}" datatype="require" msg="必选项" class="col-xs-10 col-sm-5" >
						${cm:ctoption('YESNO',res.hidden) }
					</select>
				</div>
			</div>
			<div class="space-4"></div>
			<div id="hiddenDiv" class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">仅开发模式 *</div>
				<div class="col-sm-9">
					<select name="fordev" id="fordev" datatype="require" msg="必选项"  class="col-xs-10 col-sm-5" >
						${cm:ctoption('YESNO',res.fordev) }
					</select>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">默认初始界面 </div>
				<div class="col-sm-9">
					<select name="defaultInit" id="defaultInit"  class="col-xs-10 col-sm-5" >
						${cm:ctoption('YESNO',res.defaultInit) }
					</select>
				</div>
			</div> 
			<div class="space-4"></div>
				<div class="form-group">
				<div class="col-sm-3 control-label no-padding-right" for="form-field-1">备注 &nbsp</div>
				<div class="col-sm-9">
					<textarea type="text" class="col-xs-10 col-sm-5" name="remark" id="remark" placeholder="备注">${res.remark}</textarea>
				</div>
			</div>
			<hr>
			  <div class="clearfix form-group">
					<div class="col-md-offset-3 col-md-9">
					<button type="submit" class="btn btn-sm btn-info" id="sbmBtn"><i class="icon-ok bigger-110"></i>提交</button>
			  </div>
			</div>
		</form>
	</div>
</div>